#ifndef K_BYTE_RATE_H
#define K_BYTE_RATE_H
#pragma once

#include "KGlobal.h"
#include "KTicker.h"

class KByteRate {
public:
    KByteRate() : m_bytes(0), m_total(0) {}
public:
    void accumulate(size_t bytes);
    double bytesPerSecond();
    void reset();
    LONGLONG totalBytes();
private:
    KTicker m_ticker;
    volatile LONGLONG m_bytes, m_total;
};

#endif // K_BYTE_RATE_H